﻿// 在td中划线
function drawLine(x,y,color)
{
    var strHtml = "<img border='0' style='position: absolute; left: "+(x+30)+"; top: "+(y+117)+";background-color: "+color+"' src='px.gif' width=1 height=1>";
    document.write(strHtml);
}

function line(x1,y1,x2,y2,color)
{
	var tmp
	if(x1>=x2)
	{
		tmp=x1;
		x1=x2;
		x2=tmp;
		tmp=y1;
		y1=y2;
		y2=tmp;
	}
	for(var i=x1;i<=x2;i++)
	{
		x = i;
		y = (y2 - y1) / (x2 - x1) * (x - x1) + y1;
		drawLine(x,y,color);
	}
}